<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/internal/EpollService.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li><li class="navelem"><a class="el" href="dir_1865c4ce8b99f52bbeabfd52bfdd7cd3.html">internal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">EpollService.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_epoll_service_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*****************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">*  @file     TcpEpollServer.h                                                *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">*  @brief    tcp epoll操作类                                                 *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">*  @author   weiqi.li                                                        *</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">*  @email    wcmxiaolizi@foxmail.com                                         *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">*  @remarks  仅dll内部使用的文件                                             *</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">*  @version  1.0.0.0                                                         *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">*****************************************************************************/</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef __TCPEPOLLSERVER_H__</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#define __TCPEPOLLSERVER_H__</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;../../tools/tools.h&quot;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#ifdef LINUX</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_io_port_service_8h.html">IoPortService.h</a>&quot;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="epoll_8h.html">epoll.h</a>&quot;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;sys/epoll.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;sys/eventfd.h&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;sys/timerfd.h&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">using</span> std::map;</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html">   23</a></span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">class </span><a class="code" href="class_c_epoll_service.html">CEpollService</a> :<span class="keyword">public</span> <a class="code" href="class_c_io_port_service.html">CIoPortService</a></div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">   25</a></span>&#160;{</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keyword">enum</span> <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba79dbc282910419b4abeaec0980a84648">   27</a></span>&#160;    {</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba01d75b7e463e6065067355dfe8046d77">   28</a></span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba79dbc282910419b4abeaec0980a84648">Io_Succ</a>,         <span class="comment">// 读取成功</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba5e7fdb7e9e074538a494d6d569e94e3d">   29</a></span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba01d75b7e463e6065067355dfe8046d77">NoData_Recv</a>,     <span class="comment">// 无数据可读</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbae79c4d0f1fd3e659dffcf0506a16458c">   30</a></span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba5e7fdb7e9e074538a494d6d569e94e3d">NoData_Write</a>,    <span class="comment">// 无数据可写</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba344e6393e5442fe9aa5c0052c75d182d">   31</a></span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbae79c4d0f1fd3e659dffcf0506a16458c">Overflow_Write</a>,  <span class="comment">// 缓冲区不可写</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbac41b7f5c4dc4c9515637ed066186d839">   32</a></span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba344e6393e5442fe9aa5c0052c75d182d">Read_Write_Null</a>, <span class="comment">// 读写数据为空</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbaf79260a3b998ef7754ad443f65341a6f">   33</a></span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbac41b7f5c4dc4c9515637ed066186d839">No_Connect</a>,      <span class="comment">// 未连接</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba84ba029abd95e2ded3c444785d49c108">   34</a></span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbaf79260a3b998ef7754ad443f65341a6f">No_Accept</a>,       <span class="comment">// 未接收</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba84ba029abd95e2ded3c444785d49c108">Io_Error</a>         <span class="comment">// 读写错误</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    };</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <a class="code" href="class_c_epoll_service.html#aa366ff9aadad69874c0e95b240e938ed">CEpollService</a>(<a class="code" href="_sock_data_8h.html#ae8573b45542da05c99e8e2154032d606">IoCompleteFunc</a> func);</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="comment">// 重载构造函数会调用 Init函数,若Init失败则会抛出异常(CSockException)</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <a class="code" href="class_c_epoll_service.html#aa366ff9aadad69874c0e95b240e938ed">CEpollService</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock, <a class="code" href="_sock_data_8h.html#ae8573b45542da05c99e8e2154032d606">IoCompleteFunc</a> func);</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_c_epoll_service.html#ac914cf8f32c5971a0a710b317887a29d">~CEpollService</a>();</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> <a class="code" href="class_c_epoll_service.html#a19230174f8ba4395276b43be2f0b93c3">Init</a>();</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_c_sock_error.html">CSockError</a> <a class="code" href="class_c_epoll_service.html#a19230174f8ba4395276b43be2f0b93c3">Init</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock, <span class="keywordtype">bool</span> isServer = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#abe35841d40c730849a20e57ce608fe88">PostAcceptEx</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; svrSock, <a class="code" href="class_c_socket.html">CSocket</a>&amp; cliSock, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker = NULL);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#ad323799c02b088b56a557dd1a91c6ac1">PostConnectEx</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker = NULL);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#afc23d484e502e76a9e7710038e822e53">SetTimer</a>(<a class="code" href="_timer_info_8h.html#a3cdb46a4463fd5c4c305382491ab3e41">TimerInfo</a>&amp; t);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#a4a98628adcd1758a791c97b4aa9acc27">DelTimer</a>(<a class="code" href="_timer_info_8h.html#a3cdb46a4463fd5c4c305382491ab3e41">TimerInfo</a>&amp; tinfo);</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_c_epoll_service.html#a2157c1dd183cde8099b87c460ca2188c">UpdateTimer</a>(<a class="code" href="_timer_info_8h.html#a3cdb46a4463fd5c4c305382491ab3e41">TimerInfo</a>&amp; tinfo);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#a2b4f22eb37444814e94c03c9e360bc41">DeliveryWrite</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock, <span class="keyword">const</span> <span class="keywordtype">char</span>* first, <span class="keyword">const</span> <span class="keywordtype">char</span>* end, <a class="code" href="class_c_sock_addr.html">CSockAddr</a>* addr, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker = NULL);</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#a4b686add2271b0663112d6f854229ffc">DeliveryRecv</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock, <span class="keywordtype">char</span>* first, <span class="keywordtype">char</span>* end, <a class="code" href="class_c_sock_addr.html">CSockAddr</a>* addr, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker = NULL);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#a525a96b60426d812c6146efb866b9279">Post</a>(<span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>);</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="comment">/* 提供一个异步完成的关闭操作，当操作完成时会通知上层回调</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment">     * @return 成功返回0，失败返回其它值</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment">     * 多线程下仍然存在问题，不推荐使用该设计方式</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="comment">    */</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="comment">//virtual CSockError AsyncClose(CSocket&amp; sock, CStreamSocketBuffer&amp; buff, IoCompleteFunc func, void* invoker);</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_c_epoll_service.html#a66ee6d1089bf2cd40f7a1417e3a3b4c7">IsStop</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_c_epoll_service.html#a855635ef38f2ac3681883c4d04ba4caa">Run</a>();</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_c_epoll_service.html#af7843bae0a3a308e4ef61ef54d1e8071">Run_One</a>();</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_epoll_service.html#a422f78fde0b5a097ceec14c26fa58827">NotifyStop</a>();</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160; </div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_c_epoll_service.html#acc6b0ae9e8d9b39cf2a9f9c1a23ef522">IsInit</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="class_c_epoll_service.html#a9fa3df69807bd345c91be5ccaebe51cd">Close</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock);</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#a99a9df7333d02353319ef17e201a4c15">HandleRead</a>(<a class="code" href="struct_socket_data.html">SocketData</a>* sockdata);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#ac6c36cf61efb5d0ccfe983063bec046a">HandleWrite</a>(<a class="code" href="struct_socket_data.html">SocketData</a>* sockdata);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#a33fea86a364b148b7ddc5102ce9a47ae">HandleError</a>(<a class="code" href="struct_socket_data.html">SocketData</a>* sockdata, <span class="keyword">struct</span> epoll_event* event, CSockError::ErrorType setError);</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#acfa79d1dae22d2562604336469586e7f">HandleAccept</a>(std::list&lt;SocketData*&gt;&amp; waitAccepts, uint32_t events, <span class="keyword">const</span> <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#a42488e079f28df749d7d6987a4ec1aa2">HandleConnect</a>(uint32_t events, <a class="code" href="struct_socket_data.html">SocketData</a>* sockdata);</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#ab45f03755c3e55096572f0e53de87468">HandleTimeout</a>(<span class="keywordtype">bool</span> isTimeout);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_c_epoll_service.html#ad23338defe1ba3a98a4e4516549161e2">Shutdown</a>();</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="comment">/* 注册事件</span></div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;<span class="comment">     * @fd:与epoll句柄相关联的socket描述符</span></div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="comment">     * @events:注册的事件</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="comment">     * @userFd:用户传入的相关描述符</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="comment">     * @userData:用户传入的数据指针</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<span class="comment">     * @op:操作的类型</span></div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="comment">     * @return 成功返回SUCC,失败返回相应的错误码</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="comment">    */</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> <a class="code" href="class_c_epoll_service.html#a7a8de310d11154bfff2d98effa2bfca8">RegisterEvent</a>(<span class="keywordtype">int</span> fd, uint32_t events, <span class="keywordtype">void</span>* userData, <span class="keywordtype">int</span> op = EPOLL_CTL_ADD);</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160; </div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> <a class="code" href="class_c_epoll_service.html#ae09328d21d7bb9c8a88412b05f8219ed">PostCompleteEvent</a>();</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160; </div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#a6c4cb070c67f1b5bc848566c664d547f">Send</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* buff, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160; </div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#a61e294f650498651530038e824c661f0">Recv</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* buff, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#a651d7cd9f69f52769ede1541b094d076">Recvfrom</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* buf, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160; </div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#a49ebca36e1c2c905100e90c6ec6b21e7">SendTo</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* buf, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160; </div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#abbcbcf16e1a3c89c423a04b767a1e2b1">AutoRecv</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* buf, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160; </div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#a305f7df841b6f25c13fa8e7262b4d46a">AutoSend</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* buf, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160; </div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#ac2c781450672b3b497d0e46b21aa320a">Accept</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160; </div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    <a class="code" href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">IoType</a> <a class="code" href="class_c_epoll_service.html#a57c9a67004c821066cf6fdbaade29b0a">Connect</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; sockdata, <a class="code" href="class_c_sock_error.html">CSockError</a>&amp; ec);</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160; </div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#af71376c3ee42601993b7652fc9a2b5e3">HandleComplete</a>(<a class="code" href="class_s_list.html">SList</a>&lt;<a class="code" href="class_shared_ptr.html">SharedPtr&lt;OVERLAPPED_EX&gt;</a> &gt;&amp; os);</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    <span class="comment">//void UpdateTime(TimerInfo&amp; tinfo, UpdateAction ua);</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160; </div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    <span class="comment">//设置超时</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> <a class="code" href="class_c_epoll_service.html#afc23d484e502e76a9e7710038e822e53">SetTimer</a>(<a class="code" href="tools_8h.html#adbfeae90dcbc6d1e23fc52bb64339f46">DWORD64</a> timeout);</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160; </div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#aac780dddbc3041753e03d44f2edea900">HandleClose</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock);</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_epoll_service.html#aa830350c7f43915ed3d48c9bf23b6951">HandleAcceptIpc</a>(<a class="code" href="struct_socket_data.html">SocketData</a>* sockdata);</div>
<div class="line"><a name="l00283"></a><span class="lineno"><a class="line" href="class_c_epoll_service.html#a6556918aa00a0a3d85bb85b5f1667384">  283</a></span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <a class="code" href="struct_epoll_handle.html">EpollHandle</a> <a class="code" href="class_c_epoll_service.html#a6556918aa00a0a3d85bb85b5f1667384">_hEpoll</a>;                    </div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;};</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160; </div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160; </div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;<span class="preprocessor">#endif // LINUX</span></div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160; </div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;<span class="preprocessor">#endif // __TCPEPOLLSERVER_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_epoll_service_html_a4a98628adcd1758a791c97b4aa9acc27"><div class="ttname"><a href="class_c_epoll_service.html#a4a98628adcd1758a791c97b4aa9acc27">CEpollService::DelTimer</a></div><div class="ttdeci">virtual void DelTimer(TimerInfo &amp;tinfo)</div><div class="ttdoc">删除定时器</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00280">EpollService.cpp:280</a></div></div>
<div class="ttc" id="aclass_s_list_html"><div class="ttname"><a href="class_s_list.html">SList</a></div><div class="ttdoc">单链表 只提供向前访问</div><div class="ttdef"><b>Definition:</b> <a href="_s_list_8h_source.html#l00286">SList.h:286</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_abe35841d40c730849a20e57ce608fe88"><div class="ttname"><a href="class_c_epoll_service.html#abe35841d40c730849a20e57ce608fe88">CEpollService::PostAcceptEx</a></div><div class="ttdeci">virtual void PostAcceptEx(CSocket &amp;svrSock, CSocket &amp;cliSock, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NULL)</div><div class="ttdoc">投递一个接收连接请求</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00601">EpollService.cpp:601</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a305f7df841b6f25c13fa8e7262b4d46a"><div class="ttname"><a href="class_c_epoll_service.html#a305f7df841b6f25c13fa8e7262b4d46a">CEpollService::AutoSend</a></div><div class="ttdeci">IoType AutoSend(SocketData &amp;sockdata, OVERLAPPED_EX *buf, CSockError &amp;ec)</div><div class="ttdoc">自动选择调用Send/SendTo函数</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00535">EpollService.cpp:535</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_ac914cf8f32c5971a0a710b317887a29d"><div class="ttname"><a href="class_c_epoll_service.html#ac914cf8f32c5971a0a710b317887a29d">CEpollService::~CEpollService</a></div><div class="ttdeci">virtual ~CEpollService()</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00057">EpollService.cpp:57</a></div></div>
<div class="ttc" id="aclass_c_sock_error_html"><div class="ttname"><a href="class_c_sock_error.html">CSockError</a></div><div class="ttdoc">套接字错误信息类</div><div class="ttdef"><b>Definition:</b> <a href="_sock_error_8h_source.html#l00013">SockError.h:13</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a651d7cd9f69f52769ede1541b094d076"><div class="ttname"><a href="class_c_epoll_service.html#a651d7cd9f69f52769ede1541b094d076">CEpollService::Recvfrom</a></div><div class="ttdeci">IoType Recvfrom(SocketData &amp;sockdata, OVERLAPPED_EX *buf, CSockError &amp;ec)</div><div class="ttdoc">接收udp数据报文和地址信息</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00413">EpollService.cpp:413</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a6c4cb070c67f1b5bc848566c664d547f"><div class="ttname"><a href="class_c_epoll_service.html#a6c4cb070c67f1b5bc848566c664d547f">CEpollService::Send</a></div><div class="ttdeci">IoType Send(SocketData &amp;sockdata, OVERLAPPED_EX *buff, CSockError &amp;ec)</div><div class="ttdoc">发送数据</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00365">EpollService.cpp:365</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dba79dbc282910419b4abeaec0980a84648"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba79dbc282910419b4abeaec0980a84648">CEpollService::Io_Succ</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00027">EpollService.h:27</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a4b686add2271b0663112d6f854229ffc"><div class="ttname"><a href="class_c_epoll_service.html#a4b686add2271b0663112d6f854229ffc">CEpollService::DeliveryRecv</a></div><div class="ttdeci">virtual void DeliveryRecv(CSocket &amp;sock, char *first, char *end, CSockAddr *addr, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NULL)</div><div class="ttdoc">投递一个接收请求</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00741">EpollService.cpp:741</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a57c9a67004c821066cf6fdbaade29b0a"><div class="ttname"><a href="class_c_epoll_service.html#a57c9a67004c821066cf6fdbaade29b0a">CEpollService::Connect</a></div><div class="ttdeci">IoType Connect(SocketData &amp;sockdata, CSockError &amp;ec)</div><div class="ttdoc">连接套接字</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00568">EpollService.cpp:568</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dbac41b7f5c4dc4c9515637ed066186d839"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbac41b7f5c4dc4c9515637ed066186d839">CEpollService::No_Connect</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00032">EpollService.h:32</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr&lt; HandleBase &gt;</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_abbcbcf16e1a3c89c423a04b767a1e2b1"><div class="ttname"><a href="class_c_epoll_service.html#abbcbcf16e1a3c89c423a04b767a1e2b1">CEpollService::AutoRecv</a></div><div class="ttdeci">IoType AutoRecv(SocketData &amp;sockdata, OVERLAPPED_EX *buf, CSockError &amp;ec)</div><div class="ttdoc">自动选择调用Recv/Recvform函数</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00526">EpollService.cpp:526</a></div></div>
<div class="ttc" id="atools_8h_html_adbfeae90dcbc6d1e23fc52bb64339f46"><div class="ttname"><a href="tools_8h.html#adbfeae90dcbc6d1e23fc52bb64339f46">DWORD64</a></div><div class="ttdeci">unsigned long long DWORD64</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00135">tools.h:135</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a7a8de310d11154bfff2d98effa2bfca8"><div class="ttname"><a href="class_c_epoll_service.html#a7a8de310d11154bfff2d98effa2bfca8">CEpollService::RegisterEvent</a></div><div class="ttdeci">CSockError RegisterEvent(int fd, uint32_t events, void *userData, int op=EPOLL_CTL_ADD)</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00101">EpollService.cpp:101</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_acfa79d1dae22d2562604336469586e7f"><div class="ttname"><a href="class_c_epoll_service.html#acfa79d1dae22d2562604336469586e7f">CEpollService::HandleAccept</a></div><div class="ttdeci">DWORD HandleAccept(std::list&lt; SocketData * &gt; &amp;waitAccepts, uint32_t events, const CSockError &amp;ec)</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00847">EpollService.cpp:847</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_af71376c3ee42601993b7652fc9a2b5e3"><div class="ttname"><a href="class_c_epoll_service.html#af71376c3ee42601993b7652fc9a2b5e3">CEpollService::HandleComplete</a></div><div class="ttdeci">DWORD HandleComplete(SList&lt; SharedPtr&lt; OVERLAPPED_EX &gt; &gt; &amp;os)</div><div class="ttdoc">处理完成任务</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l01055">EpollService.cpp:1055</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_af7843bae0a3a308e4ef61ef54d1e8071"><div class="ttname"><a href="class_c_epoll_service.html#af7843bae0a3a308e4ef61ef54d1e8071">CEpollService::Run_One</a></div><div class="ttdeci">virtual bool Run_One()</div><div class="ttdoc">运行服务,只运行一次</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l01093">EpollService.cpp:1093</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dba84ba029abd95e2ded3c444785d49c108"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba84ba029abd95e2ded3c444785d49c108">CEpollService::Io_Error</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00034">EpollService.h:34</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a42488e079f28df749d7d6987a4ec1aa2"><div class="ttname"><a href="class_c_epoll_service.html#a42488e079f28df749d7d6987a4ec1aa2">CEpollService::HandleConnect</a></div><div class="ttdeci">DWORD HandleConnect(uint32_t events, SocketData *sockdata)</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00889">EpollService.cpp:889</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_acc6b0ae9e8d9b39cf2a9f9c1a23ef522"><div class="ttname"><a href="class_c_epoll_service.html#acc6b0ae9e8d9b39cf2a9f9c1a23ef522">CEpollService::IsInit</a></div><div class="ttdeci">virtual bool IsInit() const</div><div class="ttdoc">判断服务是否停止</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00347">EpollService.cpp:347</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_ad23338defe1ba3a98a4e4516549161e2"><div class="ttname"><a href="class_c_epoll_service.html#ad23338defe1ba3a98a4e4516549161e2">CEpollService::Shutdown</a></div><div class="ttdeci">int Shutdown()</div><div class="ttdoc">停止服务</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00063">EpollService.cpp:63</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a2b4f22eb37444814e94c03c9e360bc41"><div class="ttname"><a href="class_c_epoll_service.html#a2b4f22eb37444814e94c03c9e360bc41">CEpollService::DeliveryWrite</a></div><div class="ttdeci">virtual void DeliveryWrite(CSocket &amp;sock, const char *first, const char *end, CSockAddr *addr, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NULL)</div><div class="ttdoc">投递一个写请求</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00686">EpollService.cpp:686</a></div></div>
<div class="ttc" id="aclass_c_sock_addr_html"><div class="ttname"><a href="class_c_sock_addr.html">CSockAddr</a></div><div class="ttdoc">协议地址结构体</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00043">SockTools.h:43</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a49ebca36e1c2c905100e90c6ec6b21e7"><div class="ttname"><a href="class_c_epoll_service.html#a49ebca36e1c2c905100e90c6ec6b21e7">CEpollService::SendTo</a></div><div class="ttdeci">IoType SendTo(SocketData &amp;sockdata, OVERLAPPED_EX *buf, CSockError &amp;ec)</div><div class="ttdoc">发送udp报文数据</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00494">EpollService.cpp:494</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a6556918aa00a0a3d85bb85b5f1667384"><div class="ttname"><a href="class_c_epoll_service.html#a6556918aa00a0a3d85bb85b5f1667384">CEpollService::_hEpoll</a></div><div class="ttdeci">EpollHandle _hEpoll</div><div class="ttdoc">epoll句柄</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00283">EpollService.h:283</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_aa830350c7f43915ed3d48c9bf23b6951"><div class="ttname"><a href="class_c_epoll_service.html#aa830350c7f43915ed3d48c9bf23b6951">CEpollService::HandleAcceptIpc</a></div><div class="ttdeci">DWORD HandleAcceptIpc(SocketData *sockdata)</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00826">EpollService.cpp:826</a></div></div>
<div class="ttc" id="aepoll_8h_html"><div class="ttname"><a href="epoll_8h.html">epoll.h</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_ac6c36cf61efb5d0ccfe983063bec046a"><div class="ttname"><a href="class_c_epoll_service.html#ac6c36cf61efb5d0ccfe983063bec046a">CEpollService::HandleWrite</a></div><div class="ttdeci">DWORD HandleWrite(SocketData *sockdata)</div><div class="ttdoc">处理写完成事件</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00951">EpollService.cpp:951</a></div></div>
<div class="ttc" id="aclass_c_socket_html"><div class="ttname"><a href="class_c_socket.html">CSocket</a></div><div class="ttdoc">套接口类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8h_source.html#l00030">Socket.h:30</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html"><div class="ttname"><a href="class_c_epoll_service.html">CEpollService</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00023">EpollService.h:23</a></div></div>
<div class="ttc" id="a_sock_data_8h_html_ae8573b45542da05c99e8e2154032d606"><div class="ttname"><a href="_sock_data_8h.html#ae8573b45542da05c99e8e2154032d606">IoCompleteFunc</a></div><div class="ttdeci">DWORD(* IoCompleteFunc)(OVERLAPPED_EX *oved)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00017">SockData.h:17</a></div></div>
<div class="ttc" id="a_io_port_service_8h_html"><div class="ttname"><a href="_io_port_service_8h.html">IoPortService.h</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dba5e7fdb7e9e074538a494d6d569e94e3d"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba5e7fdb7e9e074538a494d6d569e94e3d">CEpollService::NoData_Write</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00029">EpollService.h:29</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a855635ef38f2ac3681883c4d04ba4caa"><div class="ttname"><a href="class_c_epoll_service.html#a855635ef38f2ac3681883c4d04ba4caa">CEpollService::Run</a></div><div class="ttdeci">virtual bool Run()</div><div class="ttdoc">运行服务</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l01164">EpollService.cpp:1164</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_aac780dddbc3041753e03d44f2edea900"><div class="ttname"><a href="class_c_epoll_service.html#aac780dddbc3041753e03d44f2edea900">CEpollService::HandleClose</a></div><div class="ttdeci">DWORD HandleClose(CSocket &amp;sock)</div><div class="ttdoc">处理关闭事件</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l01074">EpollService.cpp:1074</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_ab45f03755c3e55096572f0e53de87468"><div class="ttname"><a href="class_c_epoll_service.html#ab45f03755c3e55096572f0e53de87468">CEpollService::HandleTimeout</a></div><div class="ttdeci">DWORD HandleTimeout(bool isTimeout)</div><div class="ttdoc">处理超时时间</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l01006">EpollService.cpp:1006</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a66ee6d1089bf2cd40f7a1417e3a3b4c7"><div class="ttname"><a href="class_c_epoll_service.html#a66ee6d1089bf2cd40f7a1417e3a3b4c7">CEpollService::IsStop</a></div><div class="ttdeci">virtual bool IsStop() const</div><div class="ttdoc">判断服务是否停止</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00342">EpollService.cpp:342</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a></div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00063">SockData.h:63</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dba01d75b7e463e6065067355dfe8046d77"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba01d75b7e463e6065067355dfe8046d77">CEpollService::NoData_Recv</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00028">EpollService.h:28</a></div></div>
<div class="ttc" id="astruct_socket_data_html"><div class="ttname"><a href="struct_socket_data.html">SocketData</a></div><div class="ttdoc">套接口数据</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00029">SockData.h:29</a></div></div>
<div class="ttc" id="a_timer_info_8h_html_a3cdb46a4463fd5c4c305382491ab3e41"><div class="ttname"><a href="_timer_info_8h.html#a3cdb46a4463fd5c4c305382491ab3e41">TimerInfo</a></div><div class="ttdeci">class _TimerInfo_ TimerInfo</div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a422f78fde0b5a097ceec14c26fa58827"><div class="ttname"><a href="class_c_epoll_service.html#a422f78fde0b5a097ceec14c26fa58827">CEpollService::NotifyStop</a></div><div class="ttdeci">virtual void NotifyStop()</div><div class="ttdoc">通知服务停止</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00352">EpollService.cpp:352</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dbaf79260a3b998ef7754ad443f65341a6f"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbaf79260a3b998ef7754ad443f65341a6f">CEpollService::No_Accept</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00033">EpollService.h:33</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_ac2c781450672b3b497d0e46b21aa320a"><div class="ttname"><a href="class_c_epoll_service.html#ac2c781450672b3b497d0e46b21aa320a">CEpollService::Accept</a></div><div class="ttdeci">IoType Accept(SocketData &amp;sockdata, CSockError &amp;ec)</div><div class="ttdoc">接收套接字</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00544">EpollService.cpp:544</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_afc23d484e502e76a9e7710038e822e53"><div class="ttname"><a href="class_c_epoll_service.html#afc23d484e502e76a9e7710038e822e53">CEpollService::SetTimer</a></div><div class="ttdeci">virtual void SetTimer(TimerInfo &amp;t)</div><div class="ttdoc">设置一个定时器</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00231">EpollService.cpp:231</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html"><div class="ttname"><a href="struct_epoll_handle.html">EpollHandle</a></div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00008">epoll.h:8</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a9fa3df69807bd345c91be5ccaebe51cd"><div class="ttname"><a href="class_c_epoll_service.html#a9fa3df69807bd345c91be5ccaebe51cd">CEpollService::Close</a></div><div class="ttdeci">virtual int Close(CSocket &amp;sock)</div><div class="ttdoc">关闭套接字,并解除与服务类的绑定</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00778">EpollService.cpp:778</a></div></div>
<div class="ttc" id="atools_8h_html_a798af1e30bc65f319c1a246cecf59e39"><div class="ttname"><a href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a></div><div class="ttdeci">unsigned int DWORD</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00134">tools.h:134</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html"><div class="ttname"><a href="class_c_io_port_service.html">CIoPortService</a></div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00032">IoPortService.h:32</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a525a96b60426d812c6146efb866b9279"><div class="ttname"><a href="class_c_epoll_service.html#a525a96b60426d812c6146efb866b9279">CEpollService::Post</a></div><div class="ttdeci">virtual void Post(const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个中断请求</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00331">EpollService.cpp:331</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_ae09328d21d7bb9c8a88412b05f8219ed"><div class="ttname"><a href="class_c_epoll_service.html#ae09328d21d7bb9c8a88412b05f8219ed">CEpollService::PostCompleteEvent</a></div><div class="ttdeci">CSockError PostCompleteEvent()</div><div class="ttdoc">发送中断事件通知</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00119">EpollService.cpp:119</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a99a9df7333d02353319ef17e201a4c15"><div class="ttname"><a href="class_c_epoll_service.html#a99a9df7333d02353319ef17e201a4c15">CEpollService::HandleRead</a></div><div class="ttdeci">DWORD HandleRead(SocketData *sockdata)</div><div class="ttdoc">处理读完成事件</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00924">EpollService.cpp:924</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a33fea86a364b148b7ddc5102ce9a47ae"><div class="ttname"><a href="class_c_epoll_service.html#a33fea86a364b148b7ddc5102ce9a47ae">CEpollService::HandleError</a></div><div class="ttdeci">DWORD HandleError(SocketData *sockdata, struct epoll_event *event, CSockError::ErrorType setError)</div><div class="ttdoc">处理错误、关闭事件</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00978">EpollService.cpp:978</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a61e294f650498651530038e824c661f0"><div class="ttname"><a href="class_c_epoll_service.html#a61e294f650498651530038e824c661f0">CEpollService::Recv</a></div><div class="ttdeci">IoType Recv(SocketData &amp;sockdata, OVERLAPPED_EX *buff, CSockError &amp;ec)</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00447">EpollService.cpp:447</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dba344e6393e5442fe9aa5c0052c75d182d"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dba344e6393e5442fe9aa5c0052c75d182d">CEpollService::Read_Write_Null</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00031">EpollService.h:31</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4dbae79c4d0f1fd3e659dffcf0506a16458c"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4dbae79c4d0f1fd3e659dffcf0506a16458c">CEpollService::Overflow_Write</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00030">EpollService.h:30</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a96a25e3a40e31c457ce09acf54def4db"><div class="ttname"><a href="class_c_epoll_service.html#a96a25e3a40e31c457ce09acf54def4db">CEpollService::IoType</a></div><div class="ttdeci">IoType</div><div class="ttdoc">接收所有数据</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00025">EpollService.h:25</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_ad323799c02b088b56a557dd1a91c6ac1"><div class="ttname"><a href="class_c_epoll_service.html#ad323799c02b088b56a557dd1a91c6ac1">CEpollService::PostConnectEx</a></div><div class="ttdeci">virtual void PostConnectEx(CSocket &amp;sock, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NULL)</div><div class="ttdoc">投递一个连接请求</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00632">EpollService.cpp:632</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_aa366ff9aadad69874c0e95b240e938ed"><div class="ttname"><a href="class_c_epoll_service.html#aa366ff9aadad69874c0e95b240e938ed">CEpollService::CEpollService</a></div><div class="ttdeci">CEpollService(IoCompleteFunc func)</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00033">EpollService.cpp:33</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a2157c1dd183cde8099b87c460ca2188c"><div class="ttname"><a href="class_c_epoll_service.html#a2157c1dd183cde8099b87c460ca2188c">CEpollService::UpdateTimer</a></div><div class="ttdeci">virtual bool UpdateTimer(TimerInfo &amp;tinfo)</div><div class="ttdoc">更新定时器</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00287">EpollService.cpp:287</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html_a19230174f8ba4395276b43be2f0b93c3"><div class="ttname"><a href="class_c_epoll_service.html#a19230174f8ba4395276b43be2f0b93c3">CEpollService::Init</a></div><div class="ttdeci">CSockError Init()</div><div class="ttdoc">初始化EPOLL事件等</div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8cpp_source.html#l00139">EpollService.cpp:139</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
